<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
    <title>省市地区</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta name="author" content="飞啊飘啊">
	<meta name="hashcode" content="787982615">
	
	<script>window.duteTag="lz";</script>
	<script type="text/javascript" src="/admin/js/dute-1.0.js"></script>
	<script type="text/javascript" src="/admin/js/jquery-1.7.1.min.js"></script>
	
	<script type="text/javascript" src="/admin/js/lazy3q.ui.js"></script>
	<script>
		document.write('<link rel="stylesheet" type="text/css" href="/admin//css/'+($.cookie('theme')||'elegant')+'/lazy3q.ui.css" /> ');
	</script>
	
	<script type="text/javascript" src="/admin/js/jquery-ui-1.10.2.custom.min.js"></script>
	
	<!-- 用户自定义js(懒加载) -->
	<script type="text/javascript" src="/admin/js/define.js"></script>
	<!-- 用户自定义css样式 -->
	<link rel="stylesheet" type="text/css" href="/admin/css/define.css"/>
	<!-- icon font -->
  	<link rel="stylesheet" href="/admin/css/iconfont.css">
	
	
	
	<script type="text/javascript">
		window.basePath="/";
		window.hashcode = "787982615";
	</script>
		
	<!-- 感谢kindeditor出品的在线HTML编辑控件 -->
	<script type="text/javascript" charset="utf-8" src="/admin/js/kindeditor/kindeditor.js"></script>
		
	<!-- 感谢My97DatePicker出品的时间控件 -->
	<script language="javascript" type="text/javascript" src="/admin/js/My97DatePicker/WdatePicker.js"></script>
	
	<!------------------------VIEW_HTML_HEAD------------------------>
	<!------------------------VIEW_HTML_HEAD------------------------>	
	
</head>
<script>
Page({
  data:{
    
  },
  onLoad: function(options) {
  	var THIS = this;
  	THIS.setData(options);
  	$.getAjax("region.get.do",options,function(protocol){
  		if(protocol.message){
  			$.toast(protocol.message);
  		}
  		document.title={
  			 "insert":"创建省市地区"
  			,"inport":"导入省市地区"
  			,"update":"修改省市地区"
  			,"detail":"省市地区详情"
  		}[options.edittype];
  		THIS.setData(protocol.data); 
  		/******************VIEW_HTML_SET_DATA******************/
  		/******************VIEW_HTML_SET_DATA******************/
  	});
  }
});
</script>
<script>
window["lzFlashUrl"]=top.lzFlashUrl||"/admin/flash/";
window["uploadUrl"]=top.uploadUrl||"/admin/upload.do";

$(function(){
		 
	$("#regionForm").form({
		"":function(){}
		,"region.id":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"region.name":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "名称不能为空";
			}
		}
		,"region.level":function(el){
		}
		,"region.parent":function(el){
		}
		,"region.fullName":function(el){
			if(el.value.length>128 && el.value.indexOf("[*]")==-1)
				return "全称最大长度为128个字符";
		}
		,"region.code":function(el){
				if(el.value.length>10)
					return "数字太大了";
					 var pattern = /^-?(0|[1-9][0-9]*)?$/;
					 if(!pattern.test(el.value))
						return "请输入正确格式的数字";			
		}
		,"region.updateTime":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "修改时间不能为空";
			}
		}
		,"region.addTime":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "添加时间不能为空";
			}
		}
		,"region.status":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "请选择状态";
			}
		}
	},function(){
		/******************************LAZY3Q_FORM_VALIDATE******************************/
		/******************************LAZY3Q_FORM_VALIDATE******************************/
	});		
});
</script>

<body style="display:none;">



<!------------------------VIEW_HTML_TOP------------------------>
<!------------------------VIEW_HTML_TOP------------------------>


<form enctype="{{inports!=null?'multipart/form-data':''}}" lz:if="{{edittype=='insert'||edittype=='update'||edittype=='detail'||edittype=='any'||edittype=='inport'}}" class="form editform edittype_{{edittype}}" ref="Region" id="regionForm" name="regionForm" target="jsoniframe" action="region.{{edittype=='any'?'update':edittype}}.do" method="post">
	<div class="head"></div>
	<div class="body">
		<div class="content">
			<div lz:if="{{edittype!='detail'}}" class="prompt" style="display:none;">
				温馨提示：请仔细填写省市地区相关信息，<span class="extrude">"*" 为必填选项。</span>
			</div>
			<br/>
			<lz:block lz:if="{{message}}">
			<br/>
			<center>
				<font color="red"><h4>{{message}}</h4></font>
			</center>
			<br/>
			</lz:block>
			<input type="hidden" value="{{complete}}" name="complete" id="complete" />
			<input type="hidden" value="{{ids}}" name="ids" id="ids" />
			<textarea name="PARAMS" id="PARAMS" style="display:none">{{PARAMS}}</textarea>
			
			
			<lz:block lz:if="{{inports}}">
			  <div class="line"></div>
			  <dl style="width:98%;">
			  	<dt>Excel文件:</dt>
			  	<dd>
			  		<input type="hidden" value="{{inports}}" name="inports" id="inports" />
			  		<input type="hidden" value="{{inport$}}" name="inport$" id="inport$" />
			  		<input name="file" name="file" type="file"/>
			  		<b>*</b>
			  		<div>
						请上传excel文件，表格列依次为：[{{inport$}}]，excel表格第一行为列名称，将不作为上传数据行
					</div>
			  	</dd>
			  </dl>
			  <div class="line"></div>
			</lz:block>
	{{lz.set("id_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"id"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"id"))))}}
	{{lz.set("id_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$id}}
	<dl lz:if="{{id_editable||id_readonly}}" class="id hidden " major  ref="id">
		<dt>编　　号:</dt>
		<dd lz:if="{{id_editable}}" input="hidden">
			<lz:block lz:if="{{region$id}}">
				{{region$id}}
			</lz:block>
			<lz:block lz:if="{{!region$id}}">
			<input type="hidden" value="{{lz.htm(region.id)}}" name="region.id" id="id" />
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{id_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="id">{{region.id}}</textarea>
		 		<span>
		 	
			 {{lz.html(region.id$||region.id)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$id}}
	{{lz.set("name_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"name"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"name"))))}}
	{{lz.set("name_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$name}}
	<dl lz:if="{{name_editable||name_readonly}}" class="name  " major  ref="name">
		<dt>名　　称:</dt>
		<dd lz:if="{{name_editable}}" input="text">
			<lz:block lz:if="{{region$name}}">
				{{region$name}}
			</lz:block>
			<lz:block lz:if="{{!region$name}}">
		 	<input type="text" class="input narrow"   name="region.name" id="name"  value="{{lz.htm(region.name)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入省市地区的名称</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{name_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="name">{{region.name}}</textarea>
		 		<span>
		 	
			 {{lz.html(region.name$||region.name)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$name}}
	{{lz.set("level_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"level"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"level"))))}}
	{{lz.set("level_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$level}}
	<dl lz:if="{{level_editable||level_readonly}}" class="ribs level  " major  ref="level">
		<dt>级　　别:</dt>
		<dd lz:if="{{level_editable}}" input="select">
			<lz:block lz:if="{{region$level}}">
				{{region$level}}
			</lz:block>
			<lz:block lz:if="{{!region$level}}">
		 	<select class="narrow" id="level" name="region.level">
		 		<option value="">请选择</option>
				<option value="1" selected='{{region.level=="1"?"selected":""}}'>省级</option>
				<option value="2" selected='{{region.level=="2"?"selected":""}}'>市级</option>
				<option value="3" selected='{{region.level=="3"?"selected":""}}'>区县级</option>
				<option value="3" selected='{{region.level=="3"?"selected":""}}'>乡镇级</option>
		 	</select>
	 	 </lz:block>
	 	 
	 	 <em>请选择省市地区的级别</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{level_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="level">{{region.level}}</textarea>
		 		<span>
		 	
			 {{lz.html(region.level$||region.level)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$level}}
	{{lz.set("parent_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"parent"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"parent"))))}}
	{{lz.set("parent_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$parent}}
	<dl lz:if="{{parent_editable||parent_readonly}}" class="ribs parent  " minor  ref="parent">
		<dt>父　　级:</dt>
		<dd lz:if="{{parent_editable}}" input="tree">
			<lz:block lz:if="{{region$parent}}">
				{{region$parent}}
			</lz:block>
			<lz:block lz:if="{{!region$parent}}">
		  			<select class="tree narrow"  id="parent" name="region.parent" action="/admin/setting/region.query.do?parenter={param}&not={{region.id}}">
						<option value="{{lz.htm(region.parent)}}">{{region.parent$||region.parent}}</option>
					</select>			  		
	 	 </lz:block>
	 	 
	 	 <em>请选择省市地区的父级</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{parent_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class="" name="region.parent" style="display:none;" id="parent">{{region.parent}}</textarea>
		 		<span>
		 	
			 <a href="javascript:void(0);" onclick="window.href('/admin/setting/region.details.html?key=region.parent}')">
			 {{lz.html(region.parent$||region.parent)}}</a>
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$parent}}
	{{lz.set("fullName_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"fullName"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"fullName"))))}}
	{{lz.set("fullName_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$fullName}}
	<dl lz:if="{{fullName_editable||fullName_readonly}}" class="ribs fullName   mider" major  ref="fullName">
		<dt>全　　称:</dt>
		<dd lz:if="{{fullName_editable}}" input="text">
			<lz:block lz:if="{{region$fullName}}">
				{{region$fullName}}
			</lz:block>
			<lz:block lz:if="{{!region$fullName}}">
		 	<input type="text" class="input mide"  maxlength="128" name="region.fullName" id="fullName"  value="{{lz.htm(region.fullName)}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请输入省市地区的全称</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{fullName_readonly}}">
		 	<div class="state-input mide">
		 		<textarea class=""  style="display:none;" id="fullName">{{region.fullName}}</textarea>
		 		<span>
		 	
			 {{lz.html(region.fullName$||region.fullName)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$fullName}}
	{{lz.set("code_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"code"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"code"))))}}
	{{lz.set("code_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$code}}
	<dl lz:if="{{code_editable||code_readonly}}" class="ribs code  " major  ref="code">
		<dt>编　　码:</dt>
		<dd lz:if="{{code_editable}}" input="number">
			<lz:block lz:if="{{region$code}}">
				{{region$code}}
			</lz:block>
			<lz:block lz:if="{{!region$code}}">
			<input onkeyup="var reg=/^-?(([1-9]\d{0,9})|0)?/;this.value=this.value.match(reg)?this.value.match(reg)[0]:''" type="text" class="input narrow"  maxlength="8" name="region.code" id="code"  value="{{lz.htm(region.code)}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请输入省市地区的编码</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{code_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="code">{{region.code}}</textarea>
		 		<span>
		 	
			 {{lz.html(region.code$||region.code)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$code}}
	{{lz.set("updateTime_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"updateTime"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"updateTime"))))}}
	{{lz.set("updateTime_readonly",(edittype=='insert'&&false)||(edittype=='update'&&true)||(edittype=='detail'))}}
	
	{{before$updateTime}}
	<dl lz:if="{{updateTime_editable||updateTime_readonly}}" class="updateTime  " major  ref="updateTime">
		<dt>修改时间:</dt>
		<dd lz:if="{{updateTime_editable}}" input="datetime">
			<lz:block lz:if="{{region$updateTime}}">
				{{region$updateTime}}
			</lz:block>
			<lz:block lz:if="{{!region$updateTime}}">
		 	<input onchange="void(0);" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="datetime input narrow" maxlength="19" name="region.updateTime" id="updateTime"  value="{{region.updateTime$}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择省市地区的修改时间</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{updateTime_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="updateTime">{{region.updateTime}}</textarea>
		 		<span>
		 	
			 {{lz.html(region.updateTime$||region.updateTime)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$updateTime}}
	{{lz.set("addTime_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"addTime"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"addTime"))))}}
	{{lz.set("addTime_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$addTime}}
	<dl lz:if="{{addTime_editable||addTime_readonly}}" class="addTime  " major  ref="addTime">
		<dt>添加时间:</dt>
		<dd lz:if="{{addTime_editable}}" input="datetime">
			<lz:block lz:if="{{region$addTime}}">
				{{region$addTime}}
			</lz:block>
			<lz:block lz:if="{{!region$addTime}}">
		 	<input onchange="void(0);" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="datetime input narrow" maxlength="19" name="region.addTime" id="addTime"  value="{{region.addTime$}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择省市地区的添加时间</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{addTime_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="addTime">{{region.addTime}}</textarea>
		 		<span>
		 	
			 {{lz.html(region.addTime$||region.addTime)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$addTime}}
	{{lz.set("status_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"status"))))&&false)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"status"))))}}
	{{lz.set("status_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$status}}
	<dl lz:if="{{status_editable||status_readonly}}" class="status  " major  ref="status">
		<dt>状　　态:</dt>
		<dd lz:if="{{status_editable}}" input="select">
			<lz:block lz:if="{{region$status}}">
				{{region$status}}
			</lz:block>
			<lz:block lz:if="{{!region$status}}">
		 	<select class="narrow" id="status" name="region.status">
		 		<option value="">请选择</option>
				<option value="1" selected='{{region.status=="1"?"selected":""}}'>正常</option>
				<option value="0" selected='{{region.status=="0"?"selected":""}}'>无效</option>
		 	</select>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择省市地区的状态</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{status_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="status">{{region.status}}</textarea>
		 		<span>
		 	
			 {{lz.html(region.status$||region.status)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$status}}
			
			
			<div class="line">
				<center lz:if="{{edittype=='insert'}}">
					<a onclick="$('.ribs').show();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:inline;padding: 0px 15px;">点击展开更多编辑项</a>
					<a onclick="$('.ribs').hide();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:none;padding: 0px 15px;">点击收起更多编辑项</a>
				</center>
			</div>
			<center class="buttons">
				<input type="hidden" value="{{region.id}}" name="region.id" id="id" />
			
			<lz:block lz:if="{{edittype=='insert'||edittype=='update'||edittype=='any'||edittype=='inport'}}">
				<button class="button" type="submit">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					保存&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
			
			<lz:block lz:if="{{edittype=='detail'}}">
				<button lz:if="{{canEdit}}" type="button" class="button" onclick='window.location.href="/admin/setting/region.edit.html?edittype=update&id={{region.id}}"'>
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					修改&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
					
			</center>
			<br/>

		</div>
	</div>
	<div class="foot"></div>		
</form>

 


<!------------------------VIEW_HTML_BOTTOM------------------------>
<!------------------------VIEW_HTML_BOTTOM------------------------>


</body>

<!------------------------VIEW_HTML_FOOTER------------------------>
<!------------------------VIEW_HTML_FOOTER------------------------>
<script>
	
	$(function(){
		if(parent.setit){
			parent.setit("/admin/setting/region.edit.html",document.title,"/admin//images/icons/Map.png");
		}
	});
	
	function cancel(){
		if(parent.closeHref){
			parent.closeHref("/admin/setting/region.edit.html");
		}else{
			$.closeModalDialog();
		}
	}


</script>
</html>